home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / eiffel.lha / flc / source / startup / startup.s < prev    next >
Encoding:
Text File  |  1996-01-17  |  1.3 KB  |  74 lines

  1.  
  2. **
  3. ** the Eiffel startup program in 68020 Assembler
  4. **
  5. ** Copyright © 1995, Guichard Damien.
  6. **
  7.  
  8. HEAP_SIZE EQU 2000
  9.  
  10.         include exec/memory.i
  11.         include exec/exec_lib.i
  12.         include dos/dos_lib.i
  13.         include globals.i
  14.  
  15. _startup
  16.         lea     (-Globals_SIZEOF,sp),sp
  17.         move.l  sp,a4
  18.  
  19.         move.l  _SysBase,(SysBase,a4)
  20.  
  21.         lea     dosname(pc),a1
  22.         move.l  #36,d0
  23.         EXEC_CALL OpenLibrary
  24.         tst.l   d0
  25.         beq.s   goaway
  26.         move.l  d0,(DOSBase,a4)
  27.  
  28.         DOS_CALL Input
  29.         move.l   d0,(stdin,a4)
  30.  
  31.         DOS_CALL Output
  32.         move.l   d0,(stdout,a4)
  33.  
  34.         move.l   #HEAP_SIZE,d0
  35.         move.l   #MEMF_ANY!MEMF_CLEAR,d1
  36.         EXEC_CALL AllocVec
  37.         tst.l   d0
  38.         beq.s   goawayclosedos
  39.         move.l  d0,(heap,a4)
  40.         move.l  d0,a3
  41.  
  42.         lea     creator(pc),a1
  43.         move.l  a1,(creation,a4)
  44.  
  45.         bsr.s   _main
  46.  
  47. * finished so free heap
  48. goawayfreeheap
  49.         move.l  (heap,a4),a1
  50.         EXEC_CALL FreeVec
  51.  
  52. * finished so close Dos library
  53. goawayclosedos
  54.         move.l  (DOSBase,a4),a1
  55.         EXEC_CALL CloseLibrary
  56.  
  57. goaway
  58.         lea     (Globals_SIZEOF,sp),sp
  59.         move.l  #0,d0
  60.         rts
  61.  
  62. * generic creation routine where a2 is the class
  63. creator
  64.         move.l  a3,d0
  65.         move.l  a2,(a3)+
  66.         add.l  (-4,a2),a3
  67.         rts
  68.  
  69. dosname DOSNAME
  70.         EVEN
  71.  
  72. _main
  73.  
  74.